﻿// ----------------------------------------------------------------------
//
// <copyright file="Online_Helper.cs" company="TheAcidToy Inc" Date="2012">
//     TheAcidToy is a registered trademark of TheAcidToy Inc. All right reserved, copywrited: 2012
// </copyright>
//
// ------------------------------------------------------------------------
using System;
using System.Runtime;
using System.Runtime.InteropServices;

public class Online_Helper
{
    //Creating the extern function...
    [DllImport("wininet.dll")]
    private extern static bool InternetGetConnectedState(out int Description, int ReservedValue);

    //Creating a function that uses the API function...
    public static bool IsConnectedToInternet()
    {
        int Desc;
        return InternetGetConnectedState(out Desc, 0);
    }
}
